package cn.hjd.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import sun.print.resources.serviceui;
import cn.hjd.po.TransList;
import cn.hjd.service.TransService;
import cn.hjd.service.impl.TransServiceImpl;
@WebServlet("/trans.gzsxt")
public class TransListController extends HttpServlet {

	/**
	 * 引入service层
	 */
	private TransService service = new TransServiceImpl();
	private static final long serialVersionUID = 1L;
	
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		//设置请求编码
		req.setCharacterEncoding("utf-8");
		//设置响应编码和MIME类型
		resp.setContentType("application/json;charset=utf-8");
		
		//1.接受标识参数 cmd ：用于判断不同的功能 
		String cmd = req.getParameter("cmd");
		if ("trans".equals(cmd)) {
			transList(req,resp);
		}
		
		
		
		
		
		
	}
	//
	private void transList(HttpServletRequest req, HttpServletResponse resp) {
		//1.接受各种条件参数
		
		//2.调用service业务方法查询出对应的用户列表
		List<TransList> trans = service.list();
		
		
		
		
		
	}
}
